<div nz-row>
  <div nz-col [nzSpan]="6" style="float:left">
    <nz-input-group [nzSuffix]="suffixIconSearch" style="width: 400px">
      <input type="text" nz-input placeholder="请输入搜索内容..." [(ngModel)]="filter" (keyup.enter)="getSuperUsers(true)">
    </nz-input-group>
    <ng-template #suffixIconSearch>
      <i nz-icon type="search"></i>
    </ng-template>
  </div>
  <div nz-col [nzSpan]="18" style="text-align: right">
    <button *szAcl="['create_user']" nz-button nzType="primary" (click)="createOrgUserModal()">
      <i class="icon-sac-usergroup-add"></i>
      创建企业
    </button>
  </div>
</div>
<div class="custom_table">
  <nz-table #userTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzTotal]="total"
    [nzLoading]="loading" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="getSuperUsers()"
    (nzCurrentPageDataChange)="currentPageDataChange($event)" (nzPageSizeChange)="getSuperUsers(true)">
    <thead>
      <tr>
        <th nzShowSort nzSortKey="name">企业</th>
        <th>企业管理员</th>
        <th>创建时间</th>
        <th>应用数量</th>
        <th nzShowSort nzSortKey="email">最后一次登录时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let data of userTable?.data">
        <td>
          <strong style="font-size: 14px">{{ data.lastName }} {{ data.firstName }}</strong>
          <br>
          <a [href]="'Mailto:' + data.email">
            {{ data.organizationName }}
          </a>
        </td>
        <td> {{ data.lastName }}{{ data.firstName }} </td>
        <td> {{ data.createTime | date}} </td>
        <td> {{ data.applications }} </td>
        <td> {{ data.lastLoginTime | date }} </td>
        <td>
          <nz-dropdown>
            <a nz-dropdown>
              更多 <i nz-icon type="down"></i>
            </a>
            <ul nz-menu nzSelectable>
              <li nz-menu-item>
                <a (click)="editOrgUserModal(data.organizationName,data.organizationUuid)">编辑企业</a>
              </li>
              <li nz-menu-item>
                <a (click)="editAdminUserModal(data.email,data.firstName,data.lastName,data.userUuid)">编辑管理员</a>
              </li>
              <li nz-menu-item>
                <a nz-popconfirm nzTitle="确定要删除吗?删除后数据将无法恢复!" [nzCondition]="switchValue"
                  (nzOnConfirm)="delete(data.organizationUuid,data.userUuid)" (nzOnCancel)="cancel()">删除
                </a>
              </li>
            </ul>
          </nz-dropdown>
        </td>
      </tr>
    </tbody>
  </nz-table>
</div>